from internal.extension.database_extension import db 
from  sqlalchemy import (Column,UUID,String,Text,DateTime,PrimaryKeyConstraint,Index)
import uuid
from datetime import datetime
 
class App(db.Model):
    __tablename__="app"
    __table_args__=(
        PrimaryKeyConstraint('id',name="pk_app_id"),
        Index("inx_app_account_id",'account_id')
    )

    id=Column(UUID,default=uuid.uuid4,nullable=False)
    account_id=Column(UUID,nullable=False)
    name=Column(String(255),default='',nullable=False)
    icon=Column(String(255),nullable=False)
    description=Column(Text,default="",nullable=False)
    updated_at=Column(DateTime,default=datetime.now,onupdate=datetime.now,nullable=False)
    created_at=Column(DateTime,default=datetime.now,nullable=False)


